package com.yjhealth.libs.businessdemo.business;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.yjhealth.libs.businessdemo.R;
import com.yjhealth.libs.commonlib.base.activity.BaseActivity;
import com.yjhealth.libs.core.utils.location.LocationConfig;
import com.yjhealth.libs.core.utils.location.LocationUtil;

/**
 * LocationUtil Demo
 */
public class LocationActivity extends BaseActivity {
    /*Default*/
    /*Util*/
    /*Flag*/
    /*View*/
    private Button btnLocation;
    private EditText etLocation;

    public static void appStart(Context context) {
        Intent intent = new Intent(context, LocationActivity.class);
        context.startActivity(intent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.businessdemo_activity_location);
        initLayout();
    }

    @Override
    protected void onRefreshView() {

    }

    @Override
    protected void initLayout() {
        super.initLayout();
        btnLocation = findViewById(R.id.btnLocation);
        etLocation = findViewById(R.id.etLocation);

        etLocation.setText("创业智慧大厦");

        btnLocation.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                LocationConfig config = new LocationConfig();
                config.name = etLocation.getText().toString();
                LocationUtil.showLocationDialogSearch(activity, config);
            }
        });
    }
}
